﻿using Pay.DTO;
using System.Collections.Generic;
using Pay.TO;

namespace Pay.IService {
    /// <summary>
    /// 功能功能接口
    /// </summary>
    public interface IFeatureService {
        /// <summary>
        /// 查询所有，按顺序
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        IEnumerable<feature_dto> Get(FeatureType type);
        /// <summary>
        /// 查询所有、将子类放在children中
        /// </summary>
        /// <param name="type"></param>
        /// <param name="depath">读取到第N级</param>
        /// <returns></returns>
        IEnumerable<feature_dto> Get(FeatureType type, int depath = 0);
        /// <summary>
        /// 返回功能菜单信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        feature_dto Get(long id);
        /// <summary>
        /// 增加功能
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        int Add(feature_dto dto);
        /// <summary>
        /// 更新功能
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        int Update(feature_dto dto);
        /// <summary>
        /// 删除功能
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int Delete(long id);
        /// <summary>
        /// 平台管理员的权限
        /// </summary>
        /// <param name="role_id"></param>
        /// <returns></returns>
        IEnumerable<feature_dto> GetByAdmin(long? role_id, FeatureType featureType = FeatureType.None);
    }
}
